// bool, Obj this, Obj other

Unit me;
Building bld;
Settlement sett;
Wagon wagon;
point pt, pt2;

me = this.AsUnit();
if(!me.IsValid()) return false;
bld = other.AsBuilding();
if(bld.IsValid()){
	if(!me.IsEnemy(bld)) return false;
	if(!me.IsValidCaptureTarget(bld)) return false;
	sett = bld.settlement;
	if(sett.IsOutpost())
		if(sett.IsIndependent())
			return false;

} else {

	wagon = other.AsWagon();
	if(wagon.IsValid()){
		if(!me.IsEnemy(wagon)) return false;
	}
}
if(me.IsHeirOf("Peaceful")) return false;
if(me.IsHeirOf("RamUnit")) return false;
if(me.IsHeirOf("Wagon")) return false;
if(me.IsHeirOf("Sentry")) return false;
if(me.IsHeirOf("ShipTransport")) return false;
if(me.IsHeirOf("BaseAnimal")) return false;

return true;
